package com.dc.controller;

import com.dc.annotation.Log;
import com.dc.common.ResponseResultVO;
import com.dc.entity.InspectionRoute;
import com.dc.entity.ro.InspectionRouteRO;
import com.dc.entity.ro.MaintenanceWorkOrderRO;
import com.dc.service.InspectionRouteService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

@Api(tags = "巡检路线表管理")
@RestController
@RequestMapping("/inspectionRoute")
public class InspectionRouteController {

    @Resource
    private InspectionRouteService inspectionRouteService;


    @Log(title = "H5点位绑定已有路线", businessDesc = "H5点位绑定已有路线")
    @ApiOperation(value = "H5点位绑定已有路线", notes = "H5点位绑定已有路线")
    @PostMapping("/insertHaveInspectionRoute")
    public ResponseResultVO insertHaveInspectionRoute(@RequestBody InspectionRouteRO ro) {
        return inspectionRouteService.insertHaveInspectionRoute(ro);
    }

    @Log(title = "H5点位绑定新建路线", businessDesc = "H5点位绑定新建路线")
    @ApiOperation(value = "H5点位绑定新建路线", notes = "H5点位绑定新建路线")
    @PostMapping("/insertNewInspectionRoute")
    public ResponseResultVO insertNewInspectionRoute(@RequestBody InspectionRouteRO ro) {
        return inspectionRouteService.insertNewInspectionRoute(ro);
    }

    @Log(title = "巡检管理", businessDesc = "增加")
    @ApiOperation(value = "PC-增加", notes = "PC-增加")
    @PostMapping("/insertInspectionRoute")
    public ResponseResultVO insertInspectionRoute(@RequestBody InspectionRouteRO ro) {
        return inspectionRouteService.insertInspectionRoute(ro);
    }


    @Log(title = "巡检管理", businessDesc = "二维码绑定点位")
    @ApiOperation(value = "H5-二维码绑定点位", notes = "H5-二维码绑定点位")
    @PostMapping("/newInspectionRoute")
    public ResponseResultVO newInspectionRoute(@RequestBody InspectionRouteRO ro) {
        return inspectionRouteService.newInspectionRoute(ro);
    }


    @Log(title = "巡检管理", businessDesc = "增加")
    @ApiOperation(value = "修改", notes = "修改")
    @PostMapping("/updateInspectionRoute")
    public ResponseResultVO updateInspectionRoute(@RequestBody InspectionRouteRO ro) {
        return inspectionRouteService.updateInspectionRoute(ro);
    }

    @ApiOperation(value = "删除", notes = "删除")
    @GetMapping("/deleteInspectionRoute")
    public ResponseResultVO deleteInspectionRoute(@RequestParam String id) {
        return inspectionRouteService.deleteInspectionRoute(id);
    }

    @ApiOperation(value = "查询列表", notes = "查询列表")
    @PostMapping("/selectInspectionRouteList")
    public ResponseResultVO<InspectionRoute> selectInspectionRouteList(@RequestBody InspectionRouteRO ro) {
        return inspectionRouteService.selectInspectionRouteList(ro);
    }


}
